<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('新增员工')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-serviceItem-add"  th:object="${employee}">
		<input id="appointmentId" name="appointmentId" type="hidden" th:field="*{id}"/>
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">员工姓名：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="name" id="serviceItemName" th:field="*{name}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">员工邮箱：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="email" id="serviceItemOriginalPrice" th:field="*{email}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">员工年龄：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="age" id="serviceItemDiscountPrice" th:field="*{age}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">是否超管：</label>
			<div class="col-sm-8">
				<div class="radio-box" th:each="dict : ${@dict.getType('bus_admin')}">
					<input type="radio" th:id="${'carPackage_' + dict.id}" name="admin"
						   th:value="${dict.value}" th:checked="${dict.isDefault}" th:field="*{admin}" required>
					<label th:for="${'carPackage_' + dict.id}" th:text="${dict.label}"></label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">部门：</label>
			<div class="col-sm-8">
				<select name="dept.id" class="form-control m-b" th:with="type=${@dept.list()}">
				<option th:each="depts : ${type}" th:text="${depts.name}" th:value="${depts.id}"
						th:selected="${depts.id}==*{dept_id}"></option>
				</select>
			</div>
		</div>
<!--		<div class="form-group">-->
<!--			<label class="col-sm-3 control-label is-required">部门：</label>-->
<!--			<div class="col-sm-8">-->
<!--				<div class="radio-box">-->
<!--					<select name="dept.id" >-->
<!--						<option value="">所有</option>-->
<!--						<option th:each="department : ${departments}" th:text="${department.name}"-->
<!--								th:value="${department.id}" th:selected="${department.id == employee.dept.id}"></option>-->
<!--					</select>-->
<!--				</div>-->
<!--			</div>-->
<!--		</div>-->
		<div class="form-group">
			<label class="col-sm-3 control-label">入职时间：</label>
			<div class="col-sm-8">
				<div class="input-group date">
					<input name="hiredate" th:value="${#dates.format(employee.hiredate, 'yyyy-MM-dd HH:mm')}"
						   class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text">
					<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">冻结状态：</label>
			<div class="col-sm-8">
				<div class="radio-box" th:each="dict : ${@dict.getType('bus_status')}">
					<input type="radio" th:id="${'carPackage_' + dict.id}" name="status" th:value="${dict.value}" th:checked="${dict.isDefault}" th:field="*{status}" required>
					<label th:for="${'carPackage_' + dict.id}" th:text="${dict.label}"></label>
				</div>
			</div>
		</div>
	</form>
</div>
<th:block th:include="common/include :: footer" />
<script type="text/javascript">
	var prefix = ctx + "/business/employee";
	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-serviceItem-add').serialize());
		}
	}
</script>
</body>
</html>
